<?php
require_once '../sub/init.php';
if(!is_mobile())header("Location: ".a('{"kind":"cert"}'));
if (ini_get('session.auto_start') == 0)session_start();
$currfields = 'mob,weixin,qq,email,RZ,truename,identitynum,photo_s,openid,subscribe,tguid,money,grade,rz_num';
require_once ZEAI.'m/my_chk_u.php';
require_once ZEAI.'cache/config_vip.php';
require_once ZEAI.'sub/ZeaiUP.php';
require_once ZEAI.'sub/www_zeai_cn_sms.php';
require_once ZEAI.'sub/liamiaez.php';
require_once ZEAI.'cache/udata.php';
require_once ZEAI.'sub/TGfun.php';
$rz_dataARR = explode(',',$_ZEAI['rz_data']);
$rz_numARR  = json_decode($_VIP['rz_num'],true);

if(!empty($t) && !in_array($t,$rz_dataARR))zeaialert('{"title":"暂无此认证项目","btnt":"我知道了","url":"-1"}');
$data_mob=(!ifmob($row['mob']))?'':$row['mob'];

$row_shalou=shalou_data($cook_uid);
if(!empty($row_shalou)){
	$data_weixin=$row_shalou['weixin'];
	$data_qq=$row_shalou['qq'];
	$data_email=$row_shalou['email'];
}else{
	$data_weixin=$row['weixin'];
	$data_qq=$row['qq'];
	$data_email=$row['email'];
}
$data_RZ=$row['RZ'];$RZarr=explode(',',$data_RZ);
$data_truename=dataIO($row['truename'],'out');
$data_identitynum=dataIO($row['identitynum'],'out');
$data_photo_s=$row['photo_s'];
$data_openid=$row['openid'];
$data_subscribe=$row['subscribe'];
$data_tguid=$row['tguid'];
$cook_money = $row['money'];
$data_grade = $row['grade'];
$data_rz_num= intval($row['rz_num']);
switch ($submitok) {
	case 'ajax_cert_weixin_update':
		$weixin=trimhtml(dataIO($weixin2,'in',30));
		if(empty($weixin))json_exit(array('flag'=>0,'msg'=>'请输入正确的微信号'));
		$tt='&lt;center&gt;   &lt;img src=\&quot;'.UP.$_ZEAI['kf_wxpic'].'\&quot;&gt;<br>&lt;font class=\&quot;C999\&quot;&gt;二维码添加验证&lt;/font&gt;   &lt;/center&gt;       请用当前微信  <font class=\&quot;blue\&quot;>'.$weixin.'</font>  添加客服微信  <font class=\&quot;blue\&quot;>'.$_ZEAI['kf_wx'].'</font>  为好友，在发送添加朋友申请里填写  <font class=\&quot;blue\&quot;>ID:'.$cook_uid.' 微信认证</font>  内容字样';
		$tt=str_replace('"',"",dataIO($tt,'outadm'));
		$tipsjson='{"title":"<center class=\" S18 \"><i class=\"ico\">&#xe67f;</i> 提交成功</center><br>'.$tt.'","btnt":"朕知道了","url":"-1"}';
		//$db->query("UPDATE ".__TBL_USER__." SET weixin='$weixin' WHERE id=".$cook_uid);
		$row = $db->ROW(__TBL_RZ__,"id","uid=".$cook_uid." AND rzid='weixin'","name");
		if (!$row){
			$db->query("INSERT INTO ".__TBL_RZ__."(uid,rzid,flag,addtime,content) VALUES ($cook_uid,'weixin',0,".ADDTIME.",'$weixin')");	
		}else{
			$db->query("UPDATE ".__TBL_RZ__." SET flag=0,addtime=".ADDTIME.",content='$weixin' WHERE uid=".$cook_uid." AND rzid='weixin'");
		}
		zeaialert($tipsjson);
		exit;
		/*		
		if (empty($RZarr) || count($RZarr)<=0 || empty($data_RZ)){
			$db->query("UPDATE ".__TBL_USER__." SET RZ='weixin' WHERE id=".$cook_uid);
		}else{
			if (!in_array('weixin',$RZarr)){
				$RZarr[]='weixin';
				$list = implode(',',$RZarr);
				$db->query("UPDATE ".__TBL_USER__." SET RZ='$list' WHERE id=".$cook_uid);
			}
		}
		$db->query("UPDATE ".__TBL_USER__." SET weixin='$weixin' WHERE id=".$cook_uid);
		$row_shalou=shalou_data($cook_uid);
		if(!empty($row_shalou)){
			$row_shalou['weixin'] = $weixin;
			$row_shalou=encode_json($row_shalou);
			$db->query("UPDATE ".__TBL_SHALOU__." SET jsonstr='$row_shalou' WHERE uid=".$cook_uid);
		}
		set_data_ed_bfb($cook_uid);
		json_exit(array('flag'=>1,'msg'=>'微信认证成功'));
		*/		
	break;
	/*************** QQ **************/
	case 'ajax_cert_qq2_yzm_get':
		$qq = $value;
		if(!ifint($qq,'0-9','5,11'))json_exit(array('flag'=>0,'msg'=>'请输入正确的QQ号'));
		if ($Temp_regyzmrenum > $_SMS['sms_yzmnum'] && $_SMS['sms_yzmnum']>0 )json_exit(array('flag'=>0,'msg'=>'你重复发送次数过多，请明天再试'));
		$_SESSION['Zeai_cn__mobyzm'] = cdstr(4);
		//
		$title='【邮箱验证码：'.$_SESSION['Zeai_cn__mobyzm'].'】'.$_ZEAI['siteName'];
		$email=$qq.'@qq.com';
		$ret = sendemail($email,$title,$title);
		//$ret['msg'] = '验证码已'.$ret['msg'].'您的QQ邮箱';
		setcookie("Temp_regyzmrenum",$Temp_regyzmrenum+1,null,"/",$_ZEAI['CookDomain']);  
		//
		$_SESSION['Zeai_cn__mob'] = $qq;
		json_exit(array('flag'=>1,'msg'=>'验证码已发送至'.$email.'邮箱，请查收'));
	break;
	case 'ajax_cert_qq2_yzm_submit':
		$qq = $value;
		if(!ifint($qq,'0-9','5,11'))json_exit(array('flag'=>0,'msg'=>'QQ号不正确'));
		if(!ifint($verify,'0-9','4'))json_exit(array('flag'=>0,'msg'=>'验证码不正确，请检查QQ邮箱'));
		$verify = intval($verify);
		if ($_SESSION['Zeai_cn__mobyzm'] != $verify || empty($_SESSION['Zeai_cn__mobyzm']))json_exit(array('flag'=>0,'msg'=>'验证码不正确，请重新获取'));
		if ($_SESSION['Zeai_cn__mob'] != $qq)json_exit(array('flag'=>0,'msg'=>'QQ号码异常，请重新获取'));doRZ('qq',$qq);
		unset($_SESSION["Zeai_cn__mobyzm"]);unset($_SESSION["Zeai_cn__mob"]);
		json_exit(array('flag'=>1,'msg'=>'QQ认证成功！'));
	break;
	/****************** email *****************/
	case 'ajax_cert_email2_yzm_get':
		$email = $value;
		if(!ifemail($email))json_exit(array('flag'=>0,'msg'=>'请输入正确的邮箱'));
		if ($Temp_regyzmrenum > $_SMS['sms_yzmnum'] && $_SMS['sms_yzmnum']>0 )json_exit(array('flag'=>0,'msg'=>'你重复发送次数过多，请明天再试'));
		$_SESSION['Zeai_cn__mobyzm'] = cdstr(4);
		//
		$title='【邮箱验证码：'.$_SESSION['Zeai_cn__mobyzm'].'】'.$_ZEAI['siteName'];
		$ret = sendemail($email,$title,$title);
		$ret['msg'] = '验证码已'.$ret['msg'].'您的邮箱';
		setcookie("Temp_regyzmrenum",$Temp_regyzmrenum+1,null,"/",$_ZEAI['CookDomain']);  
		//
		$_SESSION['Zeai_cn__mob'] = $email;
		json_exit(array('flag'=>1,'msg'=>'验证码已发送至'.$email.'邮箱，请查收'));
	break;
	case 'ajax_cert_email2_yzm_submit':
		$email = $value;
		if(!ifemail($email))json_exit(array('flag'=>0,'msg'=>'邮箱不正确'));
		if(!ifint($verify,'0-9','4'))json_exit(array('flag'=>0,'msg'=>'验证码不正确，请到邮箱检查'));
		$verify = intval($verify);
		if ($_SESSION['Zeai_cn__mobyzm'] != $verify || empty($_SESSION['Zeai_cn__mobyzm']))json_exit(array('flag'=>0,'msg'=>'验证码不正确，请重新获取'));
		if ($_SESSION['Zeai_cn__mob'] != $email)json_exit(array('flag'=>0,'msg'=>'邮箱异常，请重新获取'));doRZ('email',$email);
		unset($_SESSION["Zeai_cn__mobyzm"]);unset($_SESSION["Zeai_cn__mob"]);
		json_exit(array('flag'=>1,'msg'=>'邮箱认证成功！'));
	break;
	case 'ajax_cert_mob_addupdate':
		if(!ifmob($mob))json_exit(array('flag'=>0,'msg'=>'手机号码不正确'));
		$verify = intval($verify);
		if ($_SESSION['Zeai_cn__verify'] != $verify || empty($_SESSION['Zeai_cn__verify']))json_exit(array('flag'=>0,'msg'=>'【短信验证码】不正确，请重新获取'));
		if ($_SESSION['Zeai_cn__mob'] != $mob)json_exit(array('flag'=>0,'msg'=>'手机号码异常，请重新获取'));
		doRZ('mob',$mob);
		unset($_SESSION["Zeai_cn__mobyzm"]);
		unset($_SESSION["Zeai_cn__mob"]);
		json_exit(array('flag'=>1,'msg'=>'恭喜你！手机认证成功'));
	break;
	case 'ajax_cert_identity_update':
		$truename=dataIO(trimhtml($truename),'in',20);
		$identitynum=dataIO(trimhtml($identitynum),'in',18);
		if(!ifsfz($identitynum))json_exit(array('flag'=>0,'msg'=>'请输入正确的身份证号码'));
		$sfz1=dataIO($sfz1,'in',80);
		$sfz2=dataIO($sfz2,'in',80);
		$row = $db->ROW(__TBL_RZ__,"id,flag,path_b,path_b2","uid=".$cook_uid." AND rzid='identity'","num");
		if ($row){
			$id = $row[0];$flag = $row[1];$path_b = $row[2];$path_b2 = $row[3];
			if ($flag==0){;
				sfzRenameUpdate($sfz1,$sfz2);
				$sfz1 = str_replace('tmp','rz',$sfz1);$sfz2 = str_replace('tmp','rz',$sfz2);
				$db->query("UPDATE ".__TBL_USER__." SET truename='$truename',identitynum='$identitynum' WHERE id=".$cook_uid);
				$db->query("UPDATE ".__TBL_RZ__." SET path_b='$sfz1',path_b2='$sfz2',bz='人工实名',addtime=".ADDTIME." WHERE id=".$id);
				@up_send_userdel($path_b.'|'.$path_b2);
			}
		}else{
			sfzRenameUpdate($sfz1,$sfz2);
			$sfz1 = str_replace('tmp','rz',$sfz1);$sfz2 = str_replace('tmp','rz',$sfz2);
			if (ifpic($_ZEAI['up2']."/".$sfz1)){
				$db->query("INSERT INTO ".__TBL_RZ__."(uid,rzid,path_b,path_b2,addtime,bz) VALUES ($cook_uid,'identity','$sfz1','$sfz2',".ADDTIME.",'人工实名')");
				$db->query("UPDATE ".__TBL_USER__." SET truename='$truename',identitynum='$identitynum' WHERE id=".$cook_uid);
			}
		}
		json_exit(array('flag'=>1,'msg'=>'提交成功，请等待审核'));
	break;
	case 'ajax_cert_identity_mob3_update':
		chk_mob3_truename_sfz($truename,$identitynum,'identity');
		if($_SMS['rz_price_identity']>0){
			if($data_rz_num>0){
				$iffree=true;//免费
			}else{
				$iffree=false;//收费
			}
		}else{
			$iffree=true;//免费
		}
		if($iffree)start_net_verify($truename,$identitynum,$data_mob,'identity');
		json_exit(array('flag'=>2,'msg'=>'www.zeai.cn'));
	break;
	case 'ajax_cert_identity_mob3_update_payok':
		mob3_photo_chkpay($paykind,$payid);
		chk_mob3_truename_sfz($truename,$identitynum,'identity');
		start_net_verify($truename,$identitynum,$data_mob,'identity');
	break;
	case 'ajax_cert_photo_update':
		chk_mob3_truename_sfz($truename,$identitynum,'photo',$formphoto);
		if($_SMS['rz_price_photo']>0){
			if($data_rz_num>0){
				$iffree=true;//免费
			}else{
				$iffree=false;//收费
			}
		}else{
			$iffree=true;//免费
		}
		if($iffree)start_net_verify($truename,$identitynum,$data_mob,'photo',$formphoto);
		json_exit(array('flag'=>2,'msg'=>'www.zeai.cn'));
	break;
	case 'ajax_cert_photo_update_payok':
		mob3_photo_chkpay($paykind,$payid);
		chk_mob3_truename_sfz($truename,$identitynum,'photo',$formphoto);
		start_net_verify($truename,$identitynum,$data_mob,'photo',$formphoto);
	break;
	case 'ajax_cert_t_update':if(!empty($t))ajax_cert_fn($t,$path_b);break;
}
$nav='my';?>
<!doctype html><html><head><meta charset="utf-8">
<title>我的-<?php echo $_ZEAI['siteName'];?></title>
<?php echo HEADMETA; ?>
<link href="<?php echo RES;?>m/css/m.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<link href="<?php echo HOST;?>/cache/zeaicolor.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<link href="<?php echo RES;?>m/css/my_cert.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<script src="<?php echo RES;?>www_zeai_cn.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="<?php echo RES;?>m/js/m.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="<?php echo RES;?>m/js/my_cert.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script>var upMaxMB = <?php echo $_UP['upMaxMB']; ?>,browser='<?php echo browser();?>',up2='<?php echo $_ZEAI['up2'];?>/';
function app_upone_file(btnobj,objstr,sbj) {
	app_uploads({url:HOST+"/m1/my_cert"+zeai.extname+'?submitok='+sbj,num:1},function(e){
		var rs=zeai.jsoneval(e);
		if (rs.flag == 1){
			zeai.msg(0);zeai.msg('上传成功！');
			var img=btnobj.getElementsByTagName("img")[0];
			img.src=up2+rs.dbname;
			o(objstr).value=rs.dbname;
		}else{zeai.alert(rs.msg);}
	});	
}
</script>
<script src="<?php echo RES;?>m/js/ZeaiUP.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<?php
if (is_weixin()){
	$wxshareT   = '诚信认证中心';
	$wxshareC   = '提高诚信值，杜绝虚假，认证后，相亲成功率暴增！';
	$wxshareURL = mHref('my_cert');
	$wxsharePIC = RES.'m/img/share_cert.png?'.$_ZEAI['cache_str'];
	require_once ZEAI."api/weixin/jssdk.php";?>
	<script src="<?php echo RES;?>jweixin-1.2.0.js"></script>
	<script>
	wx.config({debug: false,
		appId: '<?php echo $signPackage["appId"];?>',
		timestamp: <?php echo $signPackage["timestamp"];?>,
		nonceStr: '<?php echo $signPackage["nonceStr"];?>',
		signature: '<?php echo $signPackage["signature"];?>',
		jsApiList: ['chooseImage','uploadImage','previewImage','hideMenuItems','onMenuShareTimeline','onMenuShareAppMessage','onMenuShareQQ','onMenuShareWeibo','previewImage']
	});
	var FX_title = '<?php echo trimhtml($wxshareT);?>',
	FX_desc  = '<?php echo trimhtml($wxshareC).'【'.$_ZEAI['siteName'].'】';?>',
	FX_link  = '<?php echo $wxshareURL; ?>',
	FX_imgurl= '<?php echo $wxsharePIC; ?>';
	wx.ready(function () {
		wx.onMenuShareAppMessage({title:FX_title,desc:FX_desc,link:FX_link,imgUrl:FX_imgurl});
		wx.onMenuShareTimeline({title:FX_title,link:FX_link,imgUrl:FX_imgurl});
	});
	</script>
<?php }?>
<style>
header.bgcolor{background-color:<?php echo $_ZEAI['mob_mbcolor'];?>}
.my_cert #yzmbtn{color:<?php echo $_ZEAI['mob_mbcolor'];?>}
.nextbtn{box-shadow:0 .3rem .8rem rgba(<?php echo c16_rgb($_ZEAI['mob_mbcolor']);?>,.4);background-color:#fff;background:-webkit-linear-gradient(315deg,rgba(<?php echo c16_rgb($_ZEAI['mob_mbcolor']);?>,.6) 0%,<?php echo $_ZEAI['mob_mbcolor'];?> 100%)}
<?php
if(empty($t))$mini_title='诚信认证';
if ($_ZEAI['m_mb']==2){
	$mini_class='top_mini4';
}else{
	$mini_class='top_mini4 zeaibg bgcolor yunbox';
}
?>
</style>
</head>
<body>
<?php
if(!empty($jumpurl)){
	$mini_href ='zeai.openurl(\''.trimhtml(dataIO($jumpurl,'out')).'\');';
}
if($_SMS['rz_mobile3']==1 && $t=='identity' || $t=='photo'){
	//$mini_class='top_mini4 bgcolor ';	
}else{
	//$mini_class='top_mini4 bgcolor yunbox';	
	require_once ZEAI.'m/top_mini.php';
}
switch ($t){case 'mob':
/**************************手机认证**************************/
	if (ifmob($data_mob) && in_array('mob',$RZarr)){
		$flagstr='<span class="flagstr LV">已认证</span>';
		$ifRz=true;
		$placeholder='输入其它手机重新认证';	
	}else{
		$flagstr='<span class="flagstr HUI">未认证</span>';
		$ifRz=false;
		$placeholder='请输入手机号码';	
	}
	?>
    <div class="my_cert">
        <div class="h1"><span class="title"><?php echo rz_data_info($t,'title');?></span><?php
            if ($flagstr != ''){echo $flagstr;}
            if ($ifRz){echo '<font>'.hidetext($data_mob,'mob').'</font>';}?>
        </div>
        <dl><dt><i class="ico">&#xe627;</i></dt><dd>
            <input name="mob" type="text" class="input_login" id="mob" placeholder="<?php echo $placeholder;?>" autocomplete="off" maxlength="11" pattern="[0-9]*" oninput="chkinputmob()">
            <span class="ico" onClick="mob.value='';this.hide();chkinputmob();" id="reset_rz">&#xe65b;</span>
        </dd></dl>
        <dl><dt><i class="ico">&#xe6c3;</i></dt><dd>
            <input name="verify" type="text" id="verify" maxlength="4" pattern="[0-9]*" placeholder="请输入短信验证码" autocomplete="off" class="input_login" />
            <button type="button" id="yzmbtn">获取验证码</button>
        </dd></dl>       
        <input type="button" value="提交认证" class="btn size4 zeaibg W85_ nextbtn" id="submitbtn_rz" onClick="chkform_verify()">
        <script>zeai.verify({mob:mob,verify:verify,yzmbtn:yzmbtn,url:'reg_diy'+zeai.ajxext+'submitok=ajax_get_verify',sec:120});</script>
    </div>
<?php break;case 'identity':
/**************************实名**************************/
	if (in_array('identity',$RZarr)){
		require_once ZEAI.'m/top_mini.php';
		$row = $db->ROW(__TBL_RZ__,"flag,addtime","uid=".$cook_uid." AND rzid='".$t."'","num");
		if ($row){
			$flag    = $row[0];
			$addtime = $row[1];
			$rztime_str=($flag==1 && !empty($addtime))?'认证时间：'.YmdHis($addtime,'YmdHis'):'';
		}		
		?>
        <div class="my_cert_ed">
            <i class="ico">&#xe67f;</i>
            <h1>您已完成《<?php echo rz_data_info('identity','title');?>》</h1><?php echo $rztime_str;?>
        </div>
    	<?php
    	goto GOTO_identity;
	}
	//运营商
	if($_SMS['rz_mobile3']==1){
		if(!in_array('mob',$RZarr))zeaialert('{"title":"请返回先进行【手机认证】才能进入实名认证","btnt":"我知道了","url":"my_cert.php"}');// || !ifmob($data_mob)?>
        <i class='ico goback gobackVip' onClick="zeai.back()">&#xe602;</i>
        <div class="my_cert mob3box">
            <form id="ZEAIFORM" action="<?php echo SELF; ?>" method="post" class="form">
                <dl><dt>本人手机</dt><dd><input name="brmob" type="text" id="brmob" maxlength="11" pattern="[0-9]*" placeholder="本人手机号" autocomplete="off"  class="input_login" value="<?php echo $data_mob;?>"  onBlur="zeai.setScrollTop(0);" readonly /></dd></dl>
                <dl><dt>真实姓名</dt><dd><input value="<?php //echo hidetext($data_truename,'truename');?>" onBlur="zeai.setScrollTop(0);" name="truename" type="text" class="input_login" id="truename" placeholder="请填写您的真实姓名" autocomplete="off" maxlength="20"></dd></dl>
                <dl><dt>身份证号</dt><dd><input value="<?php //echo hidetext($data_identitynum,'sfz');?>" onBlur="zeai.setScrollTop(0);" name="identitynum" type="text" id="identitynum" maxlength="18" placeholder="请填写您的身份证号" autocomplete="off" class="input_login" /></dd></dl>
                <dl style="border:0;margin-bottom:0px"><dt>认证费用</dt><dd>
				<?php
				$rz_price_str = '';
				if($_SMS['rz_price_identity']>0){
					if($data_rz_num>0){
						echo '<font class="C090">本次免费</font>';
						$rz_price_str='<font class="S12">原价<del>￥'.$_SMS['rz_price_identity'].'</del>，您当前尊享 <font class=Cf00>'.$data_rz_num.'</font> 次免费机会，请真实填写</font>';
						$iffree=true;
					}else{
						echo '<font class="S12">￥</font><font class="S18">'.$_SMS['rz_price_identity'].'</font>';
						$iffree=false;
						$maxnum=intval(max($rz_numARR));
						if($maxnum>0){
						foreach($rz_numARR as $key=>$value){if($value == $maxnum)$maxkey=$key;}
							$rz_price_str  = '升级【'.utitle($maxkey).'】可享受 <font class=Cf00>'.$maxnum.'</font> 次免费机会';
							$rz_price_str .= '<a href="my_vip.php?jumpurl='.mHref('cert').'" class="zeaicolor B">　立即升级</a>';
						}
					}
				}else{
					echo '<font class="C090">免费</font>';
					$iffree=true;
				}
				?>
                </dd></dl>
                <?php if(!empty($rz_price_str))echo '<div style="margin-top:1.5rem;margin-bottom:2.5rem;font-size:1.2rem;color:#999">'.$rz_price_str.'</div>';?>
    			<input type="button" value="开始认证" class="btn size4 W85_ B" id="mob3_btn">
            </form>
            <div class="linebox"><div class="line"></div><div class="title S14 BAI">温馨提醒</div></div>
            <h5 class="tips">
                <b>●</b> <?php echo $_ZEAI['siteName'];?>作为一个真实、严肃平台、我们要求用户必须完成身份证实名认证，保证会员真实可信<br><br>
                <b>●</b> 通过认证后，点亮【实名认证】图标，更能获得异性关注，大大提高交友成功率<br><br>
                <b>●</b> 通过电信+移动+联通三网联合实名校验，确保信息真实有效<br><br>
                <b>●</b> 您提交的信息仅用于本站诚信认证服务，不公开，将严格保护您的隐私安全
            </h5>
            <br><br><br>
		</div>
        <script>
		mob3_btn.onclick=function(){
			zeai.confirm('<center class="S18 B">温馨提醒</center><br>　　请填写本人手机号码、本人身份证号、本人头像，经公安库身份自动核对通过的才是真实资料。<br><br>　　第三方公安库收取核验费用，无法通过的均为虚假资料，不予退款！<br><br>　　冒用TA人信息注册或转让自己征婚信息帐号的均属违法行为，承担相应法律责任，请你真诚征婚交友，违法必究！<br><br>',function(){
				<?php if(!$iffree){?>
					money=o('money').value;o('money_str').html(money+'元');
					if(!chkform_sfz(truename.value,identitynum.value))return false;
					sessionStorage.truename=truename.value;
					sessionStorage.identitynum=identitynum.value;
					ZeaiM.div_up({obj:czbox,h:<?php echo (is_weixin())?29:36;?>});
				<?php }else{ ?>
					chkform_identity_mob3();
				<?php }?>
			});
		}
		</script>
		<?php
		if ($href=='h5finish'){?>
			<script>
				zeai.msg('正在实名验证',{time:8});
				zeai.ajax({url:HOST+'/m/my_cert'+zeai.extname,data:{payid:<?php echo intval($payid);?>,paykind:'<?php echo $paykind;?>',submitok:'ajax_cert_identity_mob3_update_payok',truename:sessionStorage.truename,identitynum:sessionStorage.identitynum}},function(e){var rs=zeai.jsoneval(e);
					zeai.msg(0);
					if (rs.flag == 1){
						zeai.msg(rs.msg,{time:2});setTimeout(function(){zeai.openurl('my_cert.php');},2000);
					}else{
						zeai.msg(rs.msg,{time:3});
					}
				});
            </script>
		<?php }?>
		<?php
		if(!$iffree){
            $jump_url = HOST.'/m/my_cert.php?t=identity&href=h5finish';
            $money = $_SMS['rz_price_identity'];
            $kind  = 7;
            echo '<input type="hidden" id="money" value="'.$money.'">';
			require_once 'my_pay.php';
		}
	//传统
	}else{
		$row = $db->ROW(__TBL_RZ__,"path_b,path_b2,flag,addtime","uid=".$cook_uid." AND rzid='identity'","num");
		if ($row){
			$path_b  = $row[0];
			$path_b2 = $row[1];
			$flag    = $row[2];
			$addtime = $row[3];
			$path_b_url  = (!empty($path_b ))?UP.$path_b:RES.'sfz1.jpg';
			$path_b2_url = (!empty($path_b2 ))?UP.$path_b2:RES.'sfz2.jpg';
			$flagstr=($flag==1)?'<span class="flagstr LV">已认证</span>':'<span class="flagstr">审核中</span>';
		}else{
			$path_b_url = RES.'sfz1.jpg';
			$path_b2_url= RES.'sfz2.jpg';
			$flag=0;
			$flagstr='<span class="flagstr HUI">未认证</span>';
		}
		if($flag==1){?>
        	<div class="my_cert_ed">
            	<i class="ico">&#xe67f;</i>
            	<h1>您已完成实名认证</h1>
            	<dl><dt>姓　　名</dt><dd><?php echo hidetext($data_truename,'truename');?></dd></dl>
            	<dl><dt>身份证号</dt><dd><?php echo hidetext($data_identitynum,'sfz');?></dd></dl>
            	<dl><dt>认证时间</dt><dd><?php echo YmdHis($addtime,'YmdHis');?></dd></dl>
            </div>
        <?php }else{ ?>
			<style>.my_cert dl{width:85%;margin:0px auto;}.my_cert .btn{margin-top:0}</style>
            <div class="my_cert">
                <div class="h1"><span class="title"><?php echo rz_data_info($t,'title');?></span><?php if ($flagstr != ''){echo $flagstr;}?></div>
                <form id="ZEAIFORM" action="<?php echo SELF; ?>" method="post">
                <dl><dt></dt><dd><input name="truename" type="text" class="input_login" id="truename" placeholder="请填写您的真实姓名" autocomplete="off" maxlength="8" value="<?php //echo hidetext($data_truename,'truename');?>"></dd></dl>
                <dl><dt></dt><dd><input name="identitynum" type="text" id="identitynum" maxlength="18" placeholder="请填写您的身份证号" autocomplete="off" class="input_login" value="<?php //echo hidetext($data_identitynum,'sfz');?>" /></dd></dl>
                <div class="sfzbox">
                    <div id="sfz1btn" <?php if($flag != 1 && is_h5app()){?> onClick=app_upone_file(this,'sfz1','ajax_sfz_up_app')<?php }?>><img src="<?php echo $path_b_url;?>"><?php if ($flag != 1){?><span>点击上传国徽面✚</span><?php }?></div>
                    <div id="sfz2btn" <?php if ($flag != 1 && is_h5app()){?> onClick=app_upone_file(this,'sfz2','ajax_sfz_up_app')<?php }?>><img src="<?php echo $path_b2_url;?>"><?php if ($flag != 1){?><span>点击上传人像面✚</span><?php }?></div>
                </div>
                <input type="button" value="提交认证" class="btn size4 zeaibg W85_ B<?php echo ($flag == 1)?' HUI':'';?>"<?php if ($flag != 1){?> onClick="chkform_identity()"<?php }?>>
                <div class="linebox"><div class="line"></div><div class="title S14 BAI">温馨提醒</div></div>
                <h5 class="tips">
                    <b>●</b> <?php echo $_ZEAI['siteName'];?>作为一个真实、严肃的婚恋平台、我们要求用户必须完成身份证实名认证，保证会员真实<br><br>
                    <b>●</b> 您上传的任何身份证图片等资料，仅供审核使用且TA人无法看到，此外，我们会对图片进行安全处理，敬请放心。
                </h5>
                <input name="submitok" type="hidden" value="ajax_cert_identity_update" />
                <input name="sfz1" id="sfz1" type="hidden" value="" />
                <input name="sfz2" id="sfz2" type="hidden" value="" />
                </form>
            </div>
            <script>
            <?php if ($flag != 1 && !is_h5app()){?>
            ZeaiUP.one({url:'my_cert'+zeai.extname,submitokBef:'ajax_sfz_',btnobj:sfz1btn,end:function(rs){zeai.msg(0);
                if(rs.flag==1){
                    var img=sfz1btn.getElementsByTagName("img")[0];
                    img.src=up2+rs.dbname;
                    sfz1.value=rs.dbname;				
                }else{zeai.msg(rs.msg);}
            }});
            ZeaiUP.one({url:'my_cert'+zeai.extname,submitokBef:'ajax_sfz_',btnobj:sfz2btn,end:function(rs){zeai.msg(0);
                if(rs.flag==1){
                    var img=sfz2btn.getElementsByTagName("img")[0];
                    img.src=up2+rs.dbname;
                    sfz2.value=rs.dbname;				
                }else{zeai.msg(rs.msg);}
            }});
            <?php }?>
            </script>
        
        <?php }?>
	<?php }?>
    <!--客服-->
	<style>#btmKefuBox{display:none}</style>
    <?php $kf_tel=dataIO($_ZEAI['kf_tel'],'out');$kf_wxpic=dataIO($_ZEAI['kf_wxpic'],'out'); $kf_mob=dataIO($_ZEAI['kf_mob'],'out');?>
    <a href="javascript:;" id="btmKefuBtn" class="btmKefuBtn zeaibg"><i class="ico">&#xe6a6;</i>客服</a>
    <div id="btmKefuBox" class="my-subscribe_box">
        <img src="<?php echo UP.$kf_wxpic;?>">
        <h3>长按二维码添加客服微信<br><br>
        <?php if (!empty($kf_tel)){?>
            <i class="ico zeaicolor">&#xe68b;</i> <a href="tel:<?php echo $kf_tel;?>" class="zeaicolor"><?php echo $kf_tel;?></a>
        <?php }else{?>
            <?php if (!empty($kf_mob)){?><i class="ico zeaicolor">&#xe68b;</i> <a href="tel:<?php echo $kf_mob;?>"><?php echo $kf_mob;?></a><?php }?>
        <?php }?>
    </h3></div>
    <script>btmKefuBtn.onclick=function(){ZeaiM.div({obj:btmKefuBox,w:26,h:29});}</script>
    <!--客服结束-->
<?php GOTO_identity:break;case 'photo':
	if (in_array('photo',$RZarr)){
		require_once ZEAI.'m/top_mini.php';
		$row = $db->ROW(__TBL_RZ__,"flag,addtime","uid=".$cook_uid." AND rzid='".$t."'","num");
		if ($row){
			$flag    = $row[0];
			$addtime = $row[1];
			$rztime_str=($flag==1 && !empty($addtime))?'认证时间：'.YmdHis($addtime,'YmdHis'):'';
		}		
		?>
        <div class="my_cert_ed">
            <i class="ico">&#xe67f;</i>
            <h1>您已完成《<?php echo rz_data_info('photo','title');?>》</h1><?php echo $rztime_str;?>
        </div>
    	<?php
    	goto GOTO_photo;
	}
	?>
	<i class='ico goback gobackVip' onClick="zeai.back()">&#xe602;</i>
	<div class="my_cert rz_photobox">
		<form id="ZEAIFORM" action="<?php echo SELF; ?>" method="post" class="form">
			<div class="rz_photo" id="rz_photo" <?php if(is_h5app()){?> onClick="rz_photo_goup()"<?php }?>><img src="<?php echo RES;?>m/img/rz_photo.jpg" ></div>
            <h4>请自拍本人正面照片</h4>
			<dl><dt>真实姓名</dt><dd><input name="truename" type="text" class="input_login" id="truename" value="<?php //echo hidetext($data_truename,'truename');?>" placeholder="请填写您的真实姓名" autocomplete="off" maxlength="8" onBlur="zeai.setScrollTop(0);"></dd></dl>
			<dl><dt>身份证号</dt><dd><input name="identitynum" type="text" id="identitynum" maxlength="18" value="<?php //echo hidetext($data_identitynum,'sfz');?>"  placeholder="请填写您的身份证号" autocomplete="off" class="input_login" onBlur="zeai.setScrollTop(0);" /></dd></dl>
			<dl style="border:0;"><dt>认证费用</dt><dd>
				<?php
				$rz_price_str = '';
				if($_SMS['rz_price_photo']>0){
					if($data_rz_num>0){
						echo '<font class="C090">本次免费</font>';
						$rz_price_str='<font class="S12">原价<del>￥'.$_SMS['rz_price_photo'].'</del>，您当前尊享 <font class=Cf00>'.$data_rz_num.'</font> 次免费机会，请真实填写</font>';
						$iffree=true;
					}else{
						echo '<font class="S12">￥</font><font class="S18">'.$_SMS['rz_price_photo'].'</font>';
						$iffree=false;
						$maxnum=intval(max($rz_numARR));
						if($maxnum>0){
							foreach($rz_numARR as $key=>$value){if($value == $maxnum)$maxkey=$key;}
							$rz_price_str  = '升级【'.utitle($maxkey).'】可享受 <font class=Cf00>'.$maxnum.'</font> 次免费机会';
							$rz_price_str .= '<a href="my_vip.php?jumpurl='.mHref('cert').'" class="zeaicolor B">　立即升级</a>';
						}
					}
				}else{
					echo '<font class="C090">免费</font>';
					$iffree=true;
				}
				?>
            </dd></dl>
            <?php if(!empty($rz_price_str))echo '<div style="margin-top:1.5rem;margin-bottom:2.5rem;font-size:1.2rem;color:#999">'.$rz_price_str.'</div>';?>
			<input type="hidden" name="formphoto" id="formphoto">
            <input type="button" value="开始认证" class="btn size4 W85_ B" id="rz_photo_btn">
		</form>
		<div class="linebox"><div class="line"></div><div class="title S14 BAI">温馨提醒</div></div>
		<h5 class="tips">
			<b>●</b> <?php echo $_ZEAI['siteName'];?>作为一个真实、严肃平台、我们要求用户必须完成身份证实名认证，保证用户真实可信<br><br>
			<b>●</b> 通过认证后，点亮【真人认证】图标，更能获得异性关注，大大提高交友成功率<br><br>
			<b>●</b> 通过上传的照片与公安库进行校验，确保信息真实有效<br><br>
			<b>●</b> 认证后的照片、身份证、姓名不公开，严格保护您的隐私安全
		</h5>
		<br><br><br><br>
	</div>
    <script>
		<?php if ($flag != 1){?>
		<?php if(is_h5app()){ ?>
		function rz_photo_goup(){
			app_uploads({url:HOST+"/m/my_cert"+zeai.extname+'?submitok=ajax_certphoto_up_app',num:1,sbj:1},function(e){
				var rs=zeai.jsoneval(e);
				if (rs.flag == 1){				
					var s=rs.dbname;
					rz_photo.html('<img src='+up2+s.replace('_s.','_b.')+'>');
					formphoto.value=s;
				}else{zeai.msg(rs.msg);}
			});
		}
	<?php }else{?>
        ZeaiUP.one({url:'my_cert'+zeai.extname,submitokBef:'ajax_certphoto_',btnobj:rz_photo,sourceType:'camera',end:function(rs){
			zeai.msg(0);
            if(rs.flag==1){
				var img=rz_photo.getElementsByTagName("img")[0];
				img.src=up2+rs.dbname;
				formphoto.value=rs.dbname;				
            }else{zeai.msg(rs.msg);}
        }});
		<?php }}?>
        rz_photo_btn.onclick=function(){
            if(zeai.empty(formphoto.value)){
                zeai.msg('请自拍上传本人正面照片');
            }else{
                zeai.confirm('<center class="S18 B">温馨提醒</center><br>　　请填写本人手机号码、本人身份证号、本人头像，经公安库身份自动核对通过的才是真实资料。<br><br>　　第三方公安库收取核验费用，无法通过的均为虚假资料，不予退款！<br><br>　　冒用TA人信息注册或转让自己征婚信息帐号的均属违法行为，承担相应法律责任，请你真诚征婚交友，违法必究！<br><br>',function(){
				<?php if(!$iffree){?>
					money=o('money').value;o('money_str').html(money+'元');
					if(!chkform_sfz(truename.value,identitynum.value))return false;
					sessionStorage.truename=truename.value;
					sessionStorage.identitynum=identitynum.value;
					sessionStorage.formphoto=formphoto.value;
					ZeaiM.div_up({obj:czbox,h:<?php echo (is_weixin())?29:36;?>});
				<?php }else{ ?>
					chkform_photo_rz();
				<?php }?>
                });
            }
        }
    </script>
	<?php
    if ($href=='h5finish'){?>
        <script>
            zeai.msg('正在真人验证',{time:8});
            zeai.ajax({url:HOST+'/m/my_cert'+zeai.extname,data:{payid:<?php echo intval($payid);?>,paykind:'<?php echo $paykind;?>',submitok:'ajax_cert_photo_update_payok',truename:sessionStorage.truename,identitynum:sessionStorage.identitynum,formphoto:sessionStorage.formphoto}},function(e){var rs=zeai.jsoneval(e);
                zeai.msg(0);
                if (rs.flag == 1){
                    zeai.msg(rs.msg,{time:2});setTimeout(function(){zeai.openurl('my_cert.php');},2000);
                }else{
                    zeai.msg(rs.msg,{time:3});
                }
            });
        </script>
    <?php }
    if(!$iffree){
        $jump_url = HOST.'/m/my_cert.php?t=photo&href=h5finish';
        $money = $_SMS['rz_price_photo'];
        $kind  = 7;
        echo '<input type="hidden" id="money" value="'.$money.'">';
        require_once 'my_pay.php';
    }?>
    <!--客服-->
	<style>#btmKefuBox{display:none}</style>
    <?php $kf_tel=dataIO($_ZEAI['kf_tel'],'out');$kf_wxpic=dataIO($_ZEAI['kf_wxpic'],'out'); $kf_mob=dataIO($_ZEAI['kf_mob'],'out');?>
    <a href="javascript:;" id="btmKefuBtn" class="btmKefuBtn zeaibg"><i class="ico">&#xe6a6;</i>客服</a>
    <div id="btmKefuBox" class="my-subscribe_box">
        <img src="<?php echo UP.$kf_wxpic;?>">
        <h3>长按二维码添加客服微信<br>
        <?php if (!empty($kf_tel)){?>
            <i class="ico zeaicolor">&#xe68b;</i> <a href="tel:<?php echo $kf_tel;?>" class="zeaicolor"><?php echo $kf_tel;?></a>
        <?php }else{?>
            <?php if (!empty($kf_mob)){?><i class="ico zeaicolor">&#xe68b;</i> <a href="tel:<?php echo $kf_mob;?>"><?php echo $kf_mob;?></a><?php }?>
        <?php }?>
    </h3></div>
    <script>btmKefuBtn.onclick=function(){ZeaiM.div({obj:btmKefuBox,w:26,h:28});}</script>
    <!--客服结束-->

<?php GOTO_photo:break;case 'store':
	if (in_array('store',$RZarr)){
		$flagstr='<span class="flagstr LV">已认证</span>';
	}else{
		$flagstr='<span class="flagstr HUI">未认证</span>';
	}
	$kf_tel=dataIO($_ZEAI['kf_tel'],'out');$kf_wxpic=dataIO($_ZEAI['kf_wxpic'],'out'); $kf_mob=dataIO($_ZEAI['kf_mob'],'out');
	?>
	<style>.my_cert_store i.big{background-image:-webkit-linear-gradient(left,rgba(<?php echo c16_rgb($_ZEAI['mob_mbcolor']);?>,.7),<?php echo $_ZEAI['mob_mbcolor'];?>);}</style>
    <div class="my_cert" style="margin-bottom:1rem">
        <div class="h1" style="margin-bottom:1rem"><span class="title"><?php echo rz_data_info($t,'title');?></span><?php if ($flagstr != ''){echo $flagstr;}?></div>
    </div>
	<div class="my_cert_store">
        <i class="ico big">&#xe71a;</i>
        <h5>需要您本人亲自到店<br>与红娘面谈沟通，工作人员人工帮您点亮，或扫码预约客服，安排红娘上门与您面谈。<?php echo (!empty($_ZEAI['kf_address']))?'<br><br><b>店面地址：'.$_ZEAI['kf_address'].'</b>':'';?></h5>
        <a class="btn size4 nextbtn yuan" id="vipbtn" onClick="ZeaiM.div({obj:btmKefuBox,w:26,h:28});">　<i class="ico">&#xe6a6;</i> 点击咨询客服　</a>
    </div>
    <div id="btmKefuBox" class="my-subscribe_box"><img src="<?php echo UP.$kf_wxpic;?>"><h3>长按二维码添加客服微信<br>咨询红娘1对1人工服务</h3></div>
<?php break;case 'weixin':
	if (in_array('weixin',$RZarr) && !empty($data_weixin)){
		$flagstr='<span class="flagstr LV">已认证</span>';
		$placeholder='输入其它微信号重新认证';
		$ifRz=true;?>
        <div class="my_cert_ed">
            <i class="ico">&#xe67f;</i>
            <h1>您已完成《<?php echo rz_data_info($t,'title');?>》</h1>
            微信：<?php echo substr($data_weixin,0,2).'***'.substr($data_weixin,-2,2);?>
        </div>
		<?php
	}else{
		$flagstr='<span class="flagstr HUI">未认证</span>';
		$placeholder=' 请填写您的微信号';	
		$ifRz=false;
		$row = $db->ROW(__TBL_RZ__,"flag,content","uid=".$cook_uid." AND rzid='".$t."'","num");
		if ($row && $row[0]==0){
			$flagstr='<span class="flagstr HUANG">审核中</span>';	
			$data_weixin = trimhtml(dataIO($row[1],'out'));
		}?>
		<div class="my_cert">
			<div class="h1"><span class="title"><?php echo rz_data_info($t,'title');?></span><?php if ($flagstr != ''){echo $flagstr;}?></div>
			<form id="ZEAIFORM" method="post" action="<?php echo SELF;?>">
			<dl><dt><i class="ico">&#xe607;</i></dt><dd>
				<input name="weixin2" type="text" class="input_login" id="weixin2" value="<?php echo $data_weixin;?>" placeholder="<?php echo $placeholder;?>" autocomplete="off" maxlength="30">
			</dd></dl>
			<input name="submitok" type="hidden" value="ajax_cert_weixin_update" />
			<input type="submit" value="提交认证" class="btn size4 zeaibg W85_ nextbtn">
			<div class="linebox"><div class="line W50"></div><div class="title S14 BAI">温馨提醒</div></div>
			<h5 class="C666">微信认证成功后，将点亮微信图标<br><br></h5>
			</form>
		</div>
<?php }break;case 'qq':
	if (in_array('qq',$RZarr) && ifint($data_qq,'0-9','5,11')){
		$flagstr='<span class="flagstr LV">已认证</span>';
		$placeholder='输入其它QQ号重新认证';
		$ifRz=true;
	}else{
		$flagstr='<span class="flagstr HUI">未认证</span>';
		$placeholder='请填写您的QQ号';	
		$ifRz=false;
	}?>
    <div class="my_cert">
        <div class="h1"><span class="title"><?php echo rz_data_info($t,'title');?></span><?php if ($flagstr != ''){echo $flagstr;}?></div>
        <form id="ZEAIFORM">
        <dl><dt><i class="ico">&#xe630;</i></dt><dd>
            <input name="qq2" type="text" class="input_login" id="qq2" placeholder="<?php echo $placeholder;?>" autocomplete="off" maxlength="11" pattern="[0-9]*">
        </dd></dl>
        <dl><dt><i class="ico">&#xe6c3;</i></dt><dd>
            <input name="verify" type="text" id="verify" maxlength="4" pattern="[0-9]*" placeholder="填qq邮箱收的验证码" autocomplete="off" class="input_login" />
            <button type="button" id="yzmbtn">获取验证码</button>
        </dd></dl>       
        <input type="button" value="提交认证" class="btn size4 nextbtn W85_" id="submitbtn_qq2">
        
        <div class="linebox"><div class="line W50"></div><div class="title S14 BAI">温馨提醒</div></div>
        <h5 class="C666">
            QQ认证成功后，将点亮QQ图标。<br><br>
        </h5>
        </form>
    </div>
	<script>yzmInit({"obj":qq2,"btn":yzmbtn,S:120,T:'请输入您的QQ号',url:'my_cert'+zeai.extname,form:ZEAIFORM});</script>
<?php break;case 'email':
	if (in_array('email',$RZarr) && ifemail($data_email)){
		$flagstr='<span class="flagstr LV">已认证</span>';
		$placeholder='输入其它邮箱重新认证';
		$ifRz=true;
	}else{
		$flagstr='<span class="flagstr HUI">未认证</span>';
		$placeholder='请填写您的邮箱';	
		$ifRz=false;
	}
	?>
    <div class="my_cert">
        <div class="h1"><span class="title"><?php echo rz_data_info($t,'title');?></span><?php if ($flagstr != ''){echo $flagstr;}?></div>
        <form id="ZEAIFORM">
        <dl><dt><i class="ico">&#xe641;</i></dt><dd>
            <input name="email2" type="text" class="input_login" id="email2" placeholder="<?php echo $placeholder;?>" autocomplete="off" maxlength="50">
        </dd></dl>
        <dl><dt><i class="ico">&#xe6c3;</i></dt><dd>
            <input name="verify" type="text" id="verify" maxlength="4" pattern="[0-9]*" placeholder="填此邮箱收的验证码" autocomplete="off" class="input_login" />
            <button type="button" id="yzmbtn">获取验证码</button>
        </dd></dl>       
        <input type="button" value="保存并提交" class="btn size4 W85_ nextbtn" id="submitbtn_email2">
        
        <div class="linebox"><div class="line W50"></div><div class="title S14 BAI">温馨提醒</div></div>
        <h5 class="C666">
            邮箱认证成功后，将点亮邮箱图标。<br><br>
        </h5>
        </form>
    </div>
	<script>yzmInit({"obj":email2,"btn":yzmbtn,"S":120,"T":'请输入您的邮箱',"url":'my_cert'+zeai.extname,"form":ZEAIFORM});</script>
<?php break;}
if ($t == 'edu'||$t == 'car'||$t == 'house'||$t == 'love'||$t == 'pay'){
/**************************学历，汽车，房产，认证**************************/
	switch ($t) {
		case 'edu':$objtitle  = '学历';$objtitle2 = '本人学历证书';break;
		case 'car':$objtitle  = '汽车';$objtitle2 = '本人名下行驶证';break;
		case 'house':$objtitle= '房产';$objtitle2 = '本人名下房产证';break;
		case 'love':$objtitle= '婚况';$objtitle2 = '本人单身证明或离婚证';break;
		case 'pay':$objtitle= '收入';$objtitle2 = '本人最近1年收入证明或流水';break;
	}
	$row = $db->ROW(__TBL_RZ__,"path_b,flag,addtime","uid=".$cook_uid." AND rzid='".$t."'","num");
	if ($row){
		$path_b  = $row[0];
		$flag    = $row[1];
		$addtime = $row[2];
		$path_b_url  = (!empty($path_b ))?UP.$path_b:RES.'res/sfz1.jpg?'.$_ZEAI['cache_str'];
		$flagstr=($flag==1)?'<span class="flagstr LV">已认证</span>':'<span class="flagstr">审核中</span>';
	}else{
		$path_b_url = RES.'cert_'.$t.'.jpg';
		$flag=0;
		$flagstr='<span class="flagstr HUI">未认证</span>';
	}
	if($flag==1){?>
        <div class="my_cert_ed">
            <i class="ico">&#xe67f;</i>
            <h1>您已完成《<?php echo rz_data_info($t,'title');?>》</h1>
            认证时间：<?php echo YmdHis($addtime,'YmdHis');?>
        </div>
    <?php }else{ ?>
        <div class="my_cert">
            <div class="h1"><span class="title"><?php echo rz_data_info($t,'title');?></span><?php if ($flagstr != ''){echo $flagstr;}?></div>
            <div class="certbox">
                <div id="upbtn"<?php if($flag != 1 && is_h5app()){?> onClick=app_upone_file(this,'path_b','ajax_sfz_up_app')<?php }?>><img src="<?php echo $path_b_url;?>"<?php echo ($t == 'car')?' style="height:30vw;"':'';?>><?php if ($flag != 1){?><span>点击拍照上传<?php echo $objtitle2;?> <i class="ico">&#xe609;</i></span><?php }?></div>
            </div>
            <input type="button" value="提交认证" class="btn size4 zeaibg W85_ nextbtn <?php echo ($flag == 1)?' HUI':'';?>"<?php if ($flag != 1){?> onClick="chkform_t('<?php echo $t;?>')"<?php }?>>
            <div class="linebox"><div class="line"></div><div class="title S14 BAI">温馨提醒</div></div>
            <h5 class="tips">
                <b>●</b>请拍照上传清晰的<?php echo $objtitle2;?>，如上图示例<br><br>
                <b>●</b><?php echo $objtitle;?>认证成功后，点亮<?php echo $objtitle;?>认证图标
            </h5>
        </div>
        <form id="ZEAIFORM" action="<?php echo SELF; ?>" method="post">
        <input name="submitok" type="hidden" value="ajax_cert_t_update" />
        <input name="t" id="t" type="hidden" value="<?php echo $t;?>" />
        <input name="path_b" id="path_b" type="hidden" value="" />
        </form>
        <script>
        <?php if ($flag != 1 && !is_h5app()){?>
        ZeaiUP.one({url:'my_cert'+zeai.extname,submitokBef:'ajax_sfz_',btnobj:upbtn,sourceType:'camera',end:function(rs){zeai.msg(0);
            if(rs.flag==1){
                var img=upbtn.getElementsByTagName("img")[0];
                img.src=up2+rs.dbname;
                path_b.value=rs.dbname;				
            }else{zeai.msg(rs.msg);}
        }});
        <?php }?>
        </script>
    <?php }?>
<?php }?>

<?php
function doRZ($objstr,$v='') {
	global $data_RZ,$cook_uid,$db,$RZarr;
	if (ifmob($v) && $objstr=='mob')$sql=",mob='$v'";
	if (ifint($v,'0-9','5,11') && $objstr=='qq')$sql=",qq='$v'";
	if (ifemail($v) && $objstr=='email')$sql=",email='$v'";
	if (empty($RZarr) || count($RZarr)<=0 || empty($data_RZ)){
		$db->query("UPDATE ".__TBL_USER__." SET RZ='$objstr'".$sql." WHERE id=".$cook_uid);
	}else{
		if (!in_array($objstr,$RZarr)){
			$RZarr[]=$objstr;
			$list = implode(',',$RZarr);
			$db->query("UPDATE ".__TBL_USER__." SET RZ='$list'".$sql." WHERE id=".$cook_uid);
		}else{
			$db->query("UPDATE ".__TBL_USER__." SET ".ltrim($sql,',')." WHERE id=".$cook_uid);
		}
	}
	if(ifemail($v) && $objstr=='email' || ifint($v,'0-9','5,11') && $objstr=='qq'){
		$row_shalou=shalou_data($cook_uid);
		if(!empty($row_shalou)){
			$row_shalou[$objstr] = $v;
			$row_shalou=encode_json($row_shalou);
			$db->query("UPDATE ".__TBL_SHALOU__." SET jsonstr='$row_shalou' WHERE uid=".$cook_uid);
		}
		set_data_ed_bfb($cook_uid);
	}
}
function sfzRenameUpdate($sfz1,$sfz2) {
	u_pic_reTmpDir_send($sfz1,'rz');u_pic_reTmpDir_send($sfz2,'rz');
}
function mob3_photo_chkpay($paykind,$payid) {
	global $db,$cook_uid;
	if($paykind=='rmbpay'){
		$row = $db->ROW(__TBL_MONEY_LIST__,"addtime","kind=17 AND uid=".$cook_uid." ORDER BY id DESC LIMIT 1","num");
		if ($row){
			$addtime= $row[0];
			if((ADDTIME-$addtime)>10)json_exit(array('flag'=>0,'msg'=>'余额支付异常(清单)'));
		}else{
			json_exit(array('flag'=>0,'msg'=>'余额支付异常(无记录)'));
		}
	}else{
		if(!ifint($payid))json_exit(array('flag'=>0,'msg'=>'订单ID错误，请返回重新认证'));
		$payflag=0;
		$rowpay = $db->ROW(__TBL_PAY__,"flag","id=".$payid,'num');
		if ($rowpay)$payflag= $rowpay[0];
		if ($payflag!=1)json_exit(array('flag'=>0,'msg'=>'支付失败，请重新提交认证'));
	}
}
function chk_mob3_truename_sfz($truename,$identitynum,$rzid='identity',$formphoto='') {
	global $_SMS,$data_mob,$RZarr;
	if($_SMS['rz_mobile3']!=1 && $rzid=='identity')json_exit(array('flag'=>0,'msg'=>'自助实名已关闭'));
	$truename=trimhtml($truename);$truename=str_replace("*","",$truename);
	$truename=dataIO($truename,'in',20);$identitynum=dataIO($identitynum,'in',18);
	if(empty($truename) || str_len($truename)<4 || !ifsfz($identitynum))json_exit(array('flag'=>0,'msg'=>'【姓名】或【身份证】不正确'));
	if((!in_array('mob',$RZarr) || !ifmob($data_mob)) && $rzid=='identity')json_exit(array('flag'=>0,'msg'=>'请返回先进行【手机认证】'));
	if($rzid=='photo'){
		if(empty($formphoto))json_exit(array('flag'=>0,'msg'=>'照片好像跑路了，请重新拍照上传'));
	}
}
function start_net_verify($truename,$identitynum,$data_mob,$RZstr,$formphoto='') {
	global $db,$data_RZ,$cook_uid,$data_openid,$data_subscribe;
	require_once ZEAI.'api/zeai_RZ.php';
	if($RZstr=='identity'){
		$retarr = Zeai_RZ_mob3($truename,$identitynum,$data_mob);
		$orderid_title='实名认证';
		start_net_verifyUpdate($retarr,$truename,$identitynum,$data_mob,$RZstr,$formphoto,$orderid_title);
	}elseif($RZstr=='photo'){
		if(@file_exists(ZEAI.'up'.DIRECTORY_SEPARATOR.$formphoto)){
			$retarr = Zeai_RZ_face_id_card($truename,$identitynum,ZEAI.'up'.DIRECTORY_SEPARATOR.smb($formphoto,'b'));
			$orderid_title='真人认证';
			start_net_verifyUpdate($retarr,$truename,$identitynum,$data_mob,$RZstr,$formphoto,$orderid_title);
		}else{
			json_exit(array('flag'=>0,'msg'=>'请检查照片格式是否为jpg/png/gif格式'));
		}
	}
}
function start_net_verifyUpdate($retarr,$truename,$identitynum,$data_mob,$RZstr,$formphoto,$orderid_title) {
	global $db,$RZarr,$data_RZ,$cook_uid,$data_openid,$data_subscribe,$data_tguid,$_SMS;
	$db->query("UPDATE ".__TBL_USER__." SET rz_num=rz_num-1 WHERE rz_num>0 AND id=".$cook_uid);
	if($retarr['flag']==1){
		$SQL="";
		if (empty($RZarr) || count($RZarr)<=0 || empty($data_RZ)){
			$SQL .= ",RZ='$RZstr'";
		}else{
			if (!in_array($RZstr,$RZarr)){
				$RZarr[]=$RZstr;
				$list = implode(',',$RZarr);
				$SQL .= ",RZ='$list'";
			}
		}
		if($RZstr=='photo'){// && @file_exists(ZEAI.'up'.DIRECTORY_SEPARATOR.$formphoto)
			u_pic_reTmpDir_send($formphoto,'rz');
			$formphoto = str_replace('tmp','rz',$formphoto);
			$row = $db->ROW(__TBL_RZ__,"path_b","uid=".$cook_uid." AND rzid='photo'","name");
			if (!$row){
				$db->query("INSERT INTO ".__TBL_RZ__."(uid,rzid,flag,path_b,addtime,bz) VALUES ($cook_uid,'photo',1,'$formphoto',".ADDTIME.",'自助真人')");	
			}else{
				if(empty($row['path_b'])){
					$sql = ",path_b='$formphoto'";
				}else{
					$sql = ",path_b2='$formphoto'";
				}
				$db->query("UPDATE ".__TBL_RZ__." SET flag=1".$sql.",bz='自助真人',addtime=".ADDTIME." WHERE uid=".$cook_uid." AND rzid='photo'");
			}
		}elseif($RZstr=='identity'){
			$row = $db->ROW(__TBL_RZ__,"id","uid=".$cook_uid." AND rzid='identity'","name");
			if (!$row){
				$db->query("INSERT INTO ".__TBL_RZ__."(uid,rzid,flag,addtime,bz) VALUES ($cook_uid,'identity',1,".ADDTIME.",'自助实名')");	
			}else{
				$db->query("UPDATE ".__TBL_RZ__." SET flag=1,bz='自助实名',addtime=".ADDTIME." WHERE uid=".$cook_uid." AND rzid='identity'");
			}
		}
		//更新正式和沙漏		
		$row_shalou=shalou_data($cook_uid);$ifsl_update=false;
		$birthday = getSFZbirthday($identitynum);
		if(!empty($birthday)){
			$SQL .= ",birthday='$birthday'";	
			$row_shalou['birthday']=$birthday;
			$ifsl_update=true;
		}
		if(!empty($truename)){
			$SQL .= ",truename='$truename'";
			$row_shalou['truename']=$truename;
			$ifsl_update=true;
		}
		if(ifsfz($identitynum)){
			$SQL .= ",identitynum='$identitynum'";	
			$row_shalou['identitynum']=$identitynum;
			$ifsl_update=true;
		}
		if($ifsl_update){
			$jsonstr=encode_json($row_shalou);
			$db->query("UPDATE ".__TBL_SHALOU__." SET jsonstr='$jsonstr' WHERE uid=".$cook_uid);
		}
		//
		if (empty($RZarr) || count($RZarr)<=0 || empty($data_RZ)){
			$SQL .= ",RZ='$rzid'";
		}else{
			if (!in_array($rzid,$RZarr)){
				$RZarr[]=$rzid;
				$list = implode(',',$RZarr);
				$SQL .= ",RZ='$list'";
			}
		}
		//
		if(!empty($SQL))$db->query("UPDATE ".__TBL_USER__." SET endtime=".ADDTIME.$SQL." WHERE id=".$cook_uid);
		//站内通知
		$C = $truename.'您好，恭喜你'.$orderid_title.'成功!';
		$db->SendTip($cook_uid,'恭喜你，'.$orderid_title.'成功!',dataIO($C,'in'),'sys');
		//微信模版通知
		if (!empty($data_openid) && $data_subscribe==1){
			$keyword1 = '恭喜你'.$orderid_title.'成功!';
			$keyword3 = urlencode($_ZEAI['siteName']);
			$url = a('{"kind":"cert","mp":"m"}');
			@wx_mb_sent('mbbh=ZEAI_ADMIN_INFO&openid='.$data_openid.'&keyword1='.$keyword1.'&keyword3='.$keyword3.'&time='.ADDTIME.'&first='.$first.'&remark='.$remark.'&url='.$url);
		}
		json_exit(array('flag'=>1,'msg'=>'恭喜你认证成功'));
	}else{
		if($RZstr=='photo'){// && @file_exists(ZEAI.'up'.DIRECTORY_SEPARATOR.$formphoto)
			u_pic_reTmpDir_send($formphoto,'rz');
			$formphoto = str_replace('tmp','rz',$formphoto);
			$row = $db->ROW(__TBL_RZ__,"path_b","uid=".$cook_uid." AND rzid='photo'","name");
			if (!$row){
				$db->query("INSERT INTO ".__TBL_RZ__."(uid,rzid,flag,path_b,addtime,bz) VALUES ($cook_uid,'photo',0,'$formphoto',".ADDTIME.",'自助真人')");	
			}else{
				if(empty($row['path_b'])){
					$sql = ",path_b='$formphoto'";
				}else{
					$sql = ",path_b2='$formphoto'";
				}
				$db->query("UPDATE ".__TBL_RZ__." SET flag=0".$sql.",bz='自助真人',addtime=".ADDTIME." WHERE uid=".$cook_uid." AND rzid='photo'");
			}
		}elseif($RZstr=='identity'){
			$row = $db->ROW(__TBL_RZ__,"id","uid=".$cook_uid." AND rzid='identity'","name");
			if (!$row){
				$db->query("INSERT INTO ".__TBL_RZ__."(uid,rzid,flag,addtime,bz) VALUES ($cook_uid,'identity',0,".ADDTIME.",'自助实名')");	
			}else{
				$db->query("UPDATE ".__TBL_RZ__." SET flag=0,bz='自助实名',addtime=".ADDTIME." WHERE uid=".$cook_uid." AND rzid='identity'");
			}
		}
		//更新正式和沙漏		
		$row_shalou=shalou_data($cook_uid);$ifsl_update=false;
		$birthday = getSFZbirthday($identitynum);
		if(!empty($birthday)){
			$row_shalou['birthday']=$birthday;
			$ifsl_update=true;
		}
		if(!empty($truename)){
			$row_shalou['truename']=$truename;
			$ifsl_update=true;
		}
		if(ifsfz($identitynum)){
			$row_shalou['identitynum']=$identitynum;
			$ifsl_update=true;
		}
		if($ifsl_update){
			$jsonstr=encode_json($row_shalou);
			$db->query("UPDATE ".__TBL_SHALOU__." SET jsonstr='$jsonstr' WHERE uid=".$cook_uid);
		}
		//
		json_exit(array('flag'=>0,'msg'=>'最终认证结果：'.$retarr['msg']));
	}
}
function ajax_cert_fn($t,$path_b) {
	global $db,$cook_uid,$_ZEAI;
	$path_b=dataIO($path_b,'in',50);
	$row = $db->ROW(__TBL_RZ__,"id,flag,path_b","uid=".$cook_uid." AND rzid='".$t."'","num");
	if ($row){
		$id = $row[0];$flag = $row[1];$old_path_b = $row[2];
		if ($flag==0){;
			u_pic_reTmpDir_send($path_b,'rz');
			$path_b = str_replace('tmp','rz',$path_b);
			$db->query("UPDATE ".__TBL_RZ__." SET path_b='$path_b',addtime=".ADDTIME." WHERE id=".$id);
			@up_send_userdel($old_path_b);
		}
	}else{
		u_pic_reTmpDir_send($path_b,'rz');
		$path_b = str_replace('tmp','rz',$path_b);
		if (ifpic($_ZEAI['up2']."/".$path_b)){
			$db->query("INSERT INTO ".__TBL_RZ__."(uid,rzid,path_b,addtime) VALUES ($cook_uid,'".$t."','$path_b',".ADDTIME.")");
		}
	}
	json_exit(array('flag'=>1,'msg'=>'提交成功，请等待审核'));
}

/**************************主体*****************************/
if (count($rz_dataARR)>0 && is_array($rz_dataARR) && empty($t)){
	function RZchkFlag($objstr,$RZarr) {
		global $cook_uid,$db;
		if (!in_array($objstr,$RZarr)){
			$doing = $db->COUNT(__TBL_RZ__,"uid=".$cook_uid." AND rzid='$objstr' AND flag=0");
			if ($doing>0)return '<h5>审核中</h5>';
		}else{
			return '';
		}
	}?>
	<div class="my_cert_libox" id="my_cert_libox">
		<?php
		foreach ($rz_dataARR as $V){
			$pricestr='';
			if(!in_array($V,$RZarr)){
				switch ($V) {
					case 'identity':
						if($_SMS['rz_mobile3']==1){
							if($_SMS['rz_price_identity']==0){
								$pricestr='';//(免费)
							}else{
								$pricestr='(￥'.$_SMS['rz_price_identity'].')';	
							}
						}
					break;
					case 'photo':
						if($_SMS['rz_price_photo']==0){
							$pricestr='';//(免费)
						}else{
							$pricestr='(￥'.$_SMS['rz_price_photo'].')';	
						}
					break;
				}			
			}
			?>
			<li id="<?php echo $V;?>" class="rz<?php echo (in_array($V,$RZarr))?' ed':'';?>"><i class="ico <?php echo $V;?>"<?php echo (in_array($V,$RZarr))?RZbg($V):'';?>><?php echo rz_data_info($V,'ico');?></i><h3><?php echo rz_data_info($V,'title').$pricestr;?></h3><?php echo RZchkFlag($V,$RZarr);?></li>
		<?php }?>
		<div class="clear"></div>
	</div>
	<script>zeai.listEach(zeai.tag(my_cert_libox,'li'),function(obj){obj.onclick=function(){zeai.openurl('my_cert'+zeai.ajxext+'t='+obj.id);}});</script>
    <br><br>
    <div class="linebox">
        <div class="line W50"></div>
        <div class="title BAI S14">温馨提醒</div>
        <h5>认证项目越多诚信值越高，同时点亮对应的认证图标</h5>
    </div>
	<?php
}
?>
<div class="blank"></div>
<?php 
if($_ZEAI['m_mb']==2){
	require_once ZEAI.'m/bottom2.php';
}else{
	require_once ZEAI.'m/TRnav.php';
	require_once ZEAI.'m/bottom.php';
}
?>